Managing flexible adapter configurations in a computer system

ABSTRACT

Managing flexible adapter configurations in a computer system including assigning an initial amount of resources to a set of empty expansion bus slots of the computer system; detecting an adapter has been attached to one of the set of empty expansion bus slots; receiving, by a hypervisor, a request for additional resources for use by the detected adapter, wherein the additional resources are in addition to the initial amount of resources assigned to the expansion bus slot occupied by the detected adapter; determining, by the hypervisor, an availability of the additional resources for the detected adapter; in response to determining that the additional resources are available for the detected adapter, assigning, by the hypervisor at runtime, the requested additional resources to the detected adapter.

CROSS-REFERENCE TO RELATED APPLICATION

This application is a continuation application of and claims priorityfrom U.S. patent application Ser. No. 15/427,199, filed Feb. 8, 2017.

BACKGROUND Field of the Invention

The field of the invention is data processing, or, more specifically,methods, apparatus, and products for managing flexible adapterconfigurations in a computer system.

Description of Related Art

The development of the EDVAC computer system of 1948 is often cited asthe beginning of the computer era. Since that time, computer systemshave evolved into extremely complicated devices. Today's computers aremuch more sophisticated than early systems such as the EDVAC. Computersystems typically include a combination of hardware and softwarecomponents, application programs, operating systems, processors, buses,memory, input/output devices, and so on. As advances in semiconductorprocessing and computer architecture push the performance of thecomputer higher and higher, more sophisticated computer software hasevolved to take advantage of the higher performance of the hardware,resulting in computer systems today that are much more powerful thanjust a few years ago.

SUMMARY

Methods, systems, and apparatus for managing flexible adapterconfigurations in a computer system are disclosed in this specification.Managing flexible adapter configurations in a computer system includesassigning an initial amount of resources to a set of empty expansion busslots of the computer system; detecting an adapter has been attached toone of the set of empty expansion bus slots; receiving, by a hypervisor,a request for additional resources for use by the detected adapter,wherein the additional resources are in addition to the initial amountof resources assigned to the expansion bus slot occupied by the detectedadapter; determining, by the hypervisor, an availability of theadditional resources for the detected adapter; in response todetermining that the additional resources are available for the detectedadapter, assigning, by the hypervisor at runtime, the requestedadditional resources to the detected adapter.

The foregoing and other objects, features and advantages of theinvention will be apparent from the following more particulardescriptions of exemplary embodiments of the invention as illustrated inthe accompanying drawings wherein like reference numbers generallyrepresent like parts of exemplary embodiments of the invention.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 sets forth a block diagram of an example system configured formanaging flexible adapter configurations in a computer system accordingto embodiments of the present invention.

FIG. 2 sets forth a flow chart illustrating an exemplary method formanaging flexible adapter configurations in a computer system accordingto embodiments of the present invention.

FIG. 3 sets forth a flow chart illustrating an exemplary method formanaging flexible adapter configurations in a computer system accordingto embodiments of the present invention.

FIG. 4 sets forth a flow chart illustrating an exemplary method formanaging flexible adapter configurations in a computer system accordingto embodiments of the present invention.

FIG. 5 sets forth a flow chart illustrating an exemplary method formanaging flexible adapter configurations in a computer system accordingto embodiments of the present invention.

FIG. 6 sets forth a flow chart illustrating an exemplary method formanaging flexible adapter configurations in a computer system accordingto embodiments of the present invention.

DETAILED DESCRIPTION

Exemplary methods, apparatus, and products for managing flexible adapterconfigurations in a computer system in accordance with the presentinvention are described with reference to the accompanying drawings,beginning with FIG. 1. FIG. 1 sets forth a network diagram of a systemconfigured for managing flexible adapter configurations in a computersystem according to embodiments of the present invention. The exampleenvironment of FIG. 1 includes a data center (120). Such a data centermay provide clients on host devices (extremal to the data center (120))with virtualization services for enabling various cloud related productofferings.

The example data center (120) of FIG. 1 includes automated computingmachinery in the form of a computing system (102) configured formanaging flexible adapter configurations in a computer system. Thecomputing system (102) includes at least one computer processor (156) or“CPU” as well as random access memory (168) or “RAM,” which is connectedthrough a high speed memory bus (166) and bus adapter (158) to processor(156) and to other components of the computing system (102).

Stored in RANI (168) is a hypervisor (136) and a management console(138). The management console (138) may provide a user interface throughwhich a user may direct the hypervisor (136) on instantiating andmaintaining multiple logical partitions (116, 118), where each logicalpartition may provide virtualization services to one or more clients.

Also stored in RAM (168) are two instances of an operating system (154),one for each logical partition (116, 118). Operating systems useful incomputers configured for firmware management of SR-IOV adaptersaccording to various embodiments include UNIX™, Linux™, MicrosoftWindows™, AIX™, IBM's i™ operating system, and others as will occur tothose of skill in the art. The operating systems (154), hypervisor(136), and management console (138) are shown in RAM (168), but manycomponents of such software may typically be stored in non-volatilememory such as, for example, on a data storage (170) device or infirmware (132).

The computing system (102) may also include a storage device adapter(172) coupled through expansion bus (160) and bus adapter (158) toprocessor (156) and other components of the computing system (102).Storage device adapter (172) connects non-volatile data storage to thecomputing system (102) in the form of data storage (170). Storage deviceadapters useful in computers configured for managing flexible adapterconfigurations in a computer system according to various embodimentsinclude Integrated Drive Electronics (“IDE”) adapters, Small Computingsystem Interface (“SCSI”) adapters, and others as will occur to those ofskill in the art. Non-volatile computer memory also may be implementedfor as an optical disk drive, electrically erasable programmableread-only memory (so-called “EEPROM” or “Flash” memory), RAM drives, andso on, as will occur to those of skill in the art.

The example computing system (102) may also include one or moreinput/output (“I/O”) adapters (178). I/O adapters implementuser-oriented input/output through, for example, software drivers andcomputer hardware for controlling output to display devices such ascomputer display screens, as well as user input from user input devices(181) such as keyboards and mice. The example computing system (102) mayalso include a video adapter (114), which may be an example of an I/Oadapter specially designed for graphic output to a display device (180)such as a display screen or computer monitor. Video adapter (114) may beconnected to processor (156) through a high speed video bus (164), busadapter (158), and the front side bus (162), which may also be a highspeed bus.

The expansion bus (160) shown in FIG. 1 also includes several expansionslots (124, 126, 128). The expansion slots (124, 126, 128) may beavailable or unoccupied adapter terminals within a communicationsfabric, such as a peripheral component interconnect (PCI) fabric orPCI-Express fabric. Expansion slot (124) includes adapter (130), whichmay be implemented as an input/output (I/O) adapter such as a networkinterface adapter or storage adapter. The adapter (130) may be an I/Oadapter implemented as a single root input/output virtualization(SR-IOV) adapter.

SR-IOV is an extension to the PCI Express (PCIe) specification. SR-IOVallows a device, such as a network adapter, to separate access to itsresources among various PCIe hardware functions. These functions consistof the following types: A PCIe Physical Function (PF) and a PCIe VirtualFunction (VF). The PF advertises the device's SR-IOV capabilities. EachVF is associated with a device's PF. A VF shares one or more physicalresources of the device, such as a memory and a network port, with thePF and other VFs on the device. From the perspective of a logicalpartition (116, 118) instantiated by a hypervisor (136), a VF appears asa fully functional physical PCIe adapter. In this way, a single physicaladapter may be ‘shared’ amongst many logical partitions or multiplevirtual functions may be instantiated for use by a single logicalpartition. Although referred to as a ‘virtual’ function, readers ofskill in the art will recognize that a VF is in fact a physical channelthat is not a resource virtualized entirely by the hypervisor.

As a result of multiple LPAR sharing access to a single SR-IOV adapter,each SR-IOV adapter may require a greater number of resources relativeto other types of adapters. Instead of requiring that such an adapter beplugged into specific slots of the communications fabric with anappropriate amount of resources already assigned, each empty slot in thecommunications fabric may be assigned or have reserved an initial orminimal amount of resources. Once an adapter is plugged in, a requestfor additional resources for that adapter is generated and the necessaryadditional resources are then assigned to that adapter.

The resources assigned to and reserved for the adapters attached to thecommunications fabric include partitional endpoint (PE) numbers,bus/device/function (BDF) ranges, memory mapping input/output (MMIO)addresses, direct memory access (DMA) addresses, and message signalinterrupt (MSI) addresses.

For further explanation, FIG. 2 sets forth a flow chart illustrating anexemplary method for managing flexible adapter configurations in acomputer system according to embodiments of the present invention. Themethod of FIG. 2 includes assigning (202) an initial amount of resourcesto a set of empty expansion bus slots of the computer system. Assigning(202) an initial amount of resources to a set of empty expansion busslots of the computer system may be carried out by the hypervisor oranother management entity assigning or reserving a set of resources foreach empty expansion bus slot or a group of empty expansion bus slots.

The same initial amount of resources may be assigned or reserved foreach slot in the communications fabric. The initial amount of resourcesmay be a minimal amount of resources, such that all or most adaptersattached to the communications fabric will require at least the minimalamount of resources to function. For example, a PCIe fabric may includethree empty expansion slots. Each of the three empty expansion slots maybe assigned one PE number, one MMIO window, and 256 MSI addresses.

The resource allocation may be tracked by the hypervisor using slotresource array data structures. The slot resource arrays storeinformation that maps resources and resource ranges to expansion busslots. The hypervisor may maintain one slot resource array for each typeof resource assigned to the adapters.

The resources may be assigned to the empty expansion bus slotsnon-contiguously. Specifically, resources may be assigned such that aset of resources may be left unassigned between the sets of resourcesassigned to two empty expansion bus slots. The unassigned resources maybe later assigned to one of the two expansion bus slots based on therequirements of the adapter. This increases the likelihood of an adapterbeing assigned a contiguous range of resources. For example, MSIaddresses 1-255 may be initially assigned to a first expansion bus slot,and MSI addresses 864-1119 may be initially assigned to a secondexpansion bus slot. MSI addresses 256-863 would therefore be availableto assign at a later time to adapters in either expansion bus slotproviding a contiguous range of MSI address to the adapter.

The method of FIG. 2 also includes detecting (204) an adapter has beenattached to one of the set of empty expansion bus slots. Detecting (204)an adapter has been attached to one of the set of empty expansion busslots may be carried out by the hypervisor or another management entityreceiving a notification that an adapter has been plugged in to an emptyslot on the expansion bus. The set of empty expansion bus slots maycorrespond to all or a subset of expansion bus slots on a communicationsfabric.

An adapter requiring a relatively large number of resources need not beattached to a specific empty expansion bus slot. An initial amount ofresources is assigned to each slot of the expansion bus, and additionalresources are assigned, at runtime, to the adapter as required.

The method of FIG. 2 also includes receiving (206), by a hypervisor(136), a request for additional resources for use by the detectedadapter, wherein the additional resources are in addition to the initialamount of resources assigned to the expansion bus slot occupied by thedetected adapter. Receiving (206), by a hypervisor (136), a request foradditional resources for use by the detected adapter, wherein theadditional resources are in addition to the initial amount of resourcesassigned to the expansion bus slot occupied by the detected adapter maybe carried out by the hypervisor receiving a request from the adapterfor the necessary amount of resources for the adapter to operate. Therequest may be received in response to detecting that the adapter hasbeen attached to the empty slot on the expansion bus.

The method of FIG. 2 also includes determining (208), by the hypervisor(136), an availability of the additional resources for the detectedadapter. Determining (208), by the hypervisor (136), an availability ofthe additional resources for the detected adapter may be carried out bythe hypervisor comparing the requested resources to the availableresources using a slot resource array. Determining (208), by thehypervisor (136), an availability of the additional resources for thedetected adapter may also be carried out by comparing the requestedresources to the initial amount of resources previously assigned to theexpansion bus slot.

For example, determining (208), by the hypervisor (136), an availabilityof the additional resources for the detected adapter may be carried outby checking the number of VFs requested against the available contiguousPE number range size, checking the number of MSIs against the amountalready assigned, checking the number of MSIs against the availableunassigned region of MSIs, checking the number of MMIO windows against alimit for the expansion bus slot, and/or checking the number of MMIOwindows against the PCI host bridge limit.

The method of FIG. 2 also includes in response to determining that theadditional resources are available for the detected adapter, assigning(210), by the hypervisor (136) at runtime, the requested additionalresources to the detected adapter. Assigning (210), by the hypervisor(136) at runtime, the requested additional resources to the detectedadapter may be carried out by the hypervisor indicating ownership of theresources in a slot resource array. Assigning (210), by the hypervisor(136) at runtime, the requested additional resources to the detectedadapter may also be carried out by returning an identifier of theassigned resources to the adapter.

Determining that the additional resources are available may include, forexample, determining that the number of VFs requested are available as acontiguous PE number range, determining that the number of MSIs is lessthan the amount already assigned, determining that the number of MSIsare available in the unassigned region of MSIs, determining that thenumber of MMIO windows is within a limit for the expansion bus slot,and/or determining that the number of MMIO windows is less than or equalto the PCI host bridge limit.

“At runtime” refers to a state of execution of the programs executing onthe computer system, including the hypervisor. Assigning, by thehypervisor at runtime, resources to an adapter may indicate that theresources are assigned to the adapter without restarting the hypervisoror placing the hypervisor in a suspended state. Assigning, by thehypervisor at runtime, resources to an adapter may also indicate thatthe resources are assigned to the adapter while the hypervisor is in astate of execution.

For further explanation, FIG. 3 sets forth a flow chart illustrating anexemplary method for managing flexible adapter configurations in acomputer system according to embodiments of the present invention thatincludes assigning (202) an initial amount of resources to a set ofempty expansion bus slots of the computer system; detecting (204) anadapter has been attached to one of the set of empty expansion busslots; receiving (206), by a hypervisor (136), a request for additionalresources for use by the detected adapter, wherein the additionalresources are in addition to the initial amount of resources assigned tothe expansion bus slot occupied by the detected adapter; determining(208), by the hypervisor (136), an availability of the additionalresources for the detected adapter; in response to determining that theadditional resources are available for the detected adapter, assigning(210), by the hypervisor (136) at runtime, the requested additionalresources to the detected adapter.

The method of FIG. 3 differs from the method of FIG. 2, however, in thatFIG. 3 further includes, in response to determining that the additionalresources are not available for the detected adapter, generating (302)an error indicating that the additional resources are unavailable forthe detected adapter. Generating (302) an error indicating that theadditional resources are unavailable for the detected adapter may becarried out by the hypervisor or another management entity creating anerror indicating that the attached adapter requires resources that arecurrently unavailable on the computer system. The generated error may besent to a management console.

Determining that the additional resources are not available may include,for example, determining that the number of VFs requested are notavailable as a contiguous PE number range, determining that the numberof MSIs is greater than the amount already assigned and determining thatthe number of additional MSIs are not available in the unassigned regionof MSIs, determining that the number of MMIO windows is not within alimit for the expansion bus slot, and/or determining that the number ofMMIO windows is greater than the PCI host bridge limit.

For further explanation, FIG. 4 sets forth a flow chart illustrating anexemplary method for managing flexible adapter configurations in acomputer system according to embodiments of the present invention thatincludes assigning (202) an initial amount of resources to a set ofempty expansion bus slots of the computer system; detecting (204) anadapter has been attached to one of the set of empty expansion busslots; receiving (206), by a hypervisor (136), a request for additionalresources for use by the detected adapter, wherein the additionalresources are in addition to the initial amount of resources assigned tothe expansion bus slot occupied by the detected adapter; determining(208), by the hypervisor (136), an availability of the additionalresources for the detected adapter; in response to determining that theadditional resources are available for the detected adapter, assigning(210), by the hypervisor (136) at runtime, the requested additionalresources to the detected adapter.

The method of FIG. 4 differs from the method of FIG. 2, however, in thatreceiving (206), by a hypervisor (136), a request for additionalresources for use by the detected adapter, wherein the additionalresources are in addition to the initial amount of resources assigned tothe expansion bus slot occupied by the detected adapter includes wherein(402) the additional resources comprise peripheral componentinterconnect (PCI) host bridge resources, and wherein the PCI hostbridge resources comprise at least one selected from a group consistingof a virtual function, a message signaled interrupt address, and amemory mapping I/O address. The additional resources may further includea PE number, a bus/device/function (BDF) range, and direct memory access(DMA) addresses.

For further explanation, FIG. 5 sets forth a flow chart illustrating anexemplary method for managing flexible adapter configurations in acomputer system according to embodiments of the present invention thatincludes assigning (202) an initial amount of resources to a set ofempty expansion bus slots of the computer system; detecting (204) anadapter has been attached to one of the set of empty expansion busslots; receiving (206), by a hypervisor (136), a request for additionalresources for use by the detected adapter, wherein the additionalresources are in addition to the initial amount of resources assigned tothe expansion bus slot occupied by the detected adapter; determining(208), by the hypervisor (136), an availability of the additionalresources for the detected adapter; in response to determining that theadditional resources are available for the detected adapter, assigning(210), by the hypervisor (136) at runtime, the requested additionalresources to the detected adapter.

The method of FIG. 5 differs from the method of FIG. 2, however, in thatreceiving (206), by a hypervisor (136), a request for additionalresources for use by the detected adapter, wherein the additionalresources are in addition to the initial amount of resources assigned tothe expansion bus slot occupied by the detected adapter includes reading(502), by the hypervisor, a configuration file for the detected adapter.Reading (502), by the hypervisor, a configuration file for the detectedadapter may be carried out by the hypervisor accessing a storagelocation on the adapter that stores a configuration file. Theconfiguration file may include information about the adapter, includingthe resources required for operation. Reading (502), by the hypervisor,a configuration file for the detected adapter may be performed inresponse to detecting (204) that the adapter has been attached to one ofthe set of empty expansion bus slots.

Receiving (206), by a hypervisor (136), a request for additionalresources for use by the detected adapter, wherein the additionalresources are in addition to the initial amount of resources assigned tothe expansion bus slot occupied by the detected adapter also includesdetermining (504) an amount of required resources for the detectedadapter. Determining (504) an amount of required resources for thedetected adapter may be carried out by inspecting a configuration filestored on the adapter and locating information that includes aspecification of the necessary resources required to operate theadapter.

Determining (504) an amount of required resources for the detectedadapter may also be carried out by calculating the amount of requiredresources based on the initial amount of resources already assigned tothe adapter. For example, the initial amount of resources may besubtracted from the amount of required resources for the adapter todetermine the amount of additional resources to assign to the adapter.

Receiving (206), by a hypervisor (136), a request for additionalresources for use by the detected adapter, wherein the additionalresources are in addition to the initial amount of resources assigned tothe expansion bus slot occupied by the detected adapter also includesdetermining (506) that the required resources are greater than theinitial amount of resources assigned to the detected adapter.Determining (506) that the required resources are greater than theinitial amount of resources assigned to the detected adapter may becarried out by comparing the amount of required resources to the initialamount of resources previously assigned to the expansion bus slot.

For example, an empty expansion bus slot may be initially assigned 256MSI addresses. An adapter attached to the empty slot may include aconfiguration file indicating that the adapter requires, among otherthings, at least 864 MSI addresses. The hypervisor may then determinethat 608 additional MSI address should be assigned to the adapter.

For further explanation, FIG. 6 sets forth a flow chart illustrating anexemplary method for managing flexible adapter configurations in acomputer system according to embodiments of the present invention thatincludes assigning (202) an initial amount of resources to a set ofempty expansion bus slots of the computer system; detecting (204) anadapter has been attached to one of the set of empty expansion busslots; receiving (206), by a hypervisor (136), a request for additionalresources for use by the detected adapter, wherein the additionalresources are in addition to the initial amount of resources assigned tothe expansion bus slot occupied by the detected adapter; determining(208), by the hypervisor (136), an availability of the additionalresources for the detected adapter; in response to determining that theadditional resources are available for the detected adapter, assigning(210), by the hypervisor (136) at runtime, the requested additionalresources to the detected adapter.

The method of FIG. 6 differs from the method of FIG. 2, however, in thatassigning (210), by the hypervisor (136) at runtime, the requestedadditional resources to the detected adapter includes selecting (602) aresource that is adjacent to the initial resources previously assignedto the detected adapter. Selecting (602) a resource that is adjacent tothe initial resources previously assigned to the detected adapter may becarried out by inspecting a slot resource array and locating informationabout the initial amount of resources assigned to the adapter. Once theinitial amount of resources in the slot resource array is located, adetermination is made as to whether resources adjacent to (i.e.,continuous with) the initial assigned resources are available.

For example, virtual function partitionable endpoint number regions maybe assigned in contiguous blocks for SR-IOV adapters. The total numberof virtual function partitionable endpoint numbers on the PCI hostbridge may be 256, and the highest 16 numbers may be reserved forphysical functions. If there are three adapter slots on a communicationsfabric, the remaining virtual function partitionable endpoint numbersmay be divided into three contiguous segments (0-79, 80-159, and160-239). Each empty bus slot may be initially assigned 3 virtualfunction partitionable endpoints from each corresponding segment. Once aSR-IOV adapter is plugged into the communications fabric, the requestfor additional resources may be serviced by assigning resources from thecorresponding segment. Specifically, the hypervisor may assign the nextadjacent numbers to the numbers already assigned to the expansion busslot.

In view of the explanations set forth above, readers will recognize thatthe benefits of managing flexible adapter configurations in a computersystem according to embodiments of the present invention include:

-   -   Improving the operation of a computer system by enabling system        users to attach high resources use adapters to multiple        expansion bus slots, increasing convenience and usability.    -   Improving the operation of a computer system by assigning only a        minimal amount of resources to each empty expansion bus slot,        increasing resource efficiency.    -   Improving the operation of a computer system by increasing the        number of high resource use adapters able to be installed on a        single system, increasing system functionality.    -   Improving the operation of a computer system by providing a        process for post-release design change, such as adding support        for new adapter types, increasing system longevity and        stability.

Exemplary embodiments of the present invention are described largely inthe context of a fully functional computer system for managing flexibleadapter configurations in a computer system. Readers of skill in the artwill recognize, however, that the present invention also may be embodiedin a computer program product disposed upon computer readable storagemedia for use with any suitable data processing system. Such computerreadable storage media may be any storage medium for machine-readableinformation, including magnetic media, optical media, or other suitablemedia. Examples of such media include magnetic disks in hard drives ordiskettes, compact disks for optical drives, magnetic tape, and othersas will occur to those of skill in the art. Persons skilled in the artwill immediately recognize that any computer system having suitableprogramming means will be capable of executing the steps of the methodof the invention as embodied in a computer program product. Personsskilled in the art will recognize also that, although some of theexemplary embodiments described in this specification are oriented tosoftware installed and executing on computer hardware, nevertheless,alternative embodiments implemented as firmware or as hardware are wellwithin the scope of the present invention.

The present invention may be a system, a method, and/or a computerprogram product. The computer program product may include a computerreadable storage medium (or media) having computer readable programinstructions thereon for causing a processor to carry out aspects of thepresent invention.

The computer readable storage medium can be a tangible device that canretain and store instructions for use by an instruction executiondevice. The computer readable storage medium may be, for example, but isnot limited to, an electronic storage device, a magnetic storage device,an optical storage device, an electromagnetic storage device, asemiconductor storage device, or any suitable combination of theforegoing. A non-exhaustive list of more specific examples of thecomputer readable storage medium includes the following: a portablecomputer diskette, a hard disk, a random access memory (RAM), aread-only memory (ROM), an erasable programmable read-only memory (EPROMor Flash memory), a static random access memory (SRAM), a portablecompact disc read-only memory (CD-ROM), a digital versatile disk (DVD),a memory stick, a floppy disk, a mechanically encoded device such aspunch-cards or raised structures in a groove having instructionsrecorded thereon, and any suitable combination of the foregoing. Acomputer readable storage medium, as used herein, is not to be construedas being transitory signals per se, such as radio waves or other freelypropagating electromagnetic waves, electromagnetic waves propagatingthrough a waveguide or other transmission media (e.g., light pulsespassing through a fiber-optic cable), or electrical signals transmittedthrough a wire.

Computer readable program instructions described herein can bedownloaded to respective computing/processing devices from a computerreadable storage medium or to an external computer or external storagedevice via a network, for example, the Internet, a local area network, awide area network and/or a wireless network. The network may comprisecopper transmission cables, optical transmission fibers, wirelesstransmission, routers, firewalls, switches, gateway computers and/oredge servers. A network adapter card or network interface in eachcomputing/processing device receives computer readable programinstructions from the network and forwards the computer readable programinstructions for storage in a computer readable storage medium withinthe respective computing/processing device.

Computer readable program instructions for carrying out operations ofthe present invention may be assembler instructions,instruction-set-architecture (ISA) instructions, machine instructions,machine dependent instructions, microcode, firmware instructions,state-setting data, or either source code or object code written in anycombination of one or more programming languages, including an objectoriented programming language such as Smalltalk, C++ or the like, andconventional procedural programming languages, such as the “C”programming language or similar programming languages. The computerreadable program instructions may execute entirely on the user'scomputer, partly on the user's computer, as a stand-alone softwarepackage, partly on the user's computer and partly on a remote computeror entirely on the remote computer or server. In the latter scenario,the remote computer may be connected to the user's computer through anytype of network, including a local area network (LAN) or a wide areanetwork (WAN), or the connection may be made to an external computer(for example, through the Internet using an Internet Service Provider).In some embodiments, electronic circuitry including, for example,programmable logic circuitry, field-programmable gate arrays (FPGA), orprogrammable logic arrays (PLA) may execute the computer readableprogram instructions by utilizing state information of the computerreadable program instructions to personalize the electronic circuitry,in order to perform aspects of the present invention.

Aspects of the present invention are described herein with reference toflowchart illustrations and/or block diagrams of methods, apparatus(systems), and computer program products according to embodiments of theinvention. It will be understood that each block of the flowchartillustrations and/or block diagrams, and combinations of blocks in theflowchart illustrations and/or block diagrams, can be implemented bycomputer readable program instructions.

These computer readable program instructions may be provided to aprocessor of a general purpose computer, special purpose computer, orother programmable data processing apparatus to produce a machine, suchthat the instructions, which execute via the processor of the computeror other programmable data processing apparatus, create means forimplementing the functions/acts specified in the flowchart and/or blockdiagram block or blocks. These computer readable program instructionsmay also be stored in a computer readable storage medium that can directa computer, a programmable data processing apparatus, and/or otherdevices to function in a particular manner, such that the computerreadable storage medium having instructions stored therein comprises anarticle of manufacture including instructions which implement aspects ofthe function/act specified in the flowchart and/or block diagram blockor blocks.

The computer readable program instructions may also be loaded onto acomputer, other programmable data processing apparatus, or other deviceto cause a series of operational steps to be performed on the computer,other programmable apparatus or other device to produce a computerimplemented process, such that the instructions which execute on thecomputer, other programmable apparatus, or other device implement thefunctions/acts specified in the flowchart and/or block diagram block orblocks.

The flowchart and block diagrams in the Figures illustrate thearchitecture, functionality, and operation of possible implementationsof systems, methods, and computer program products according to variousembodiments of the present invention. In this regard, each block in theflowchart or block diagrams may represent a module, segment, or portionof instructions, which comprises one or more executable instructions forimplementing the specified logical function(s). In some alternativeimplementations, the functions noted in the block may occur out of theorder noted in the figures. For example, two blocks shown in successionmay, in fact, be executed substantially concurrently, or the blocks maysometimes be executed in the reverse order, depending upon thefunctionality involved. It will also be noted that each block of theblock diagrams and/or flowchart illustration, and combinations of blocksin the block diagrams and/or flowchart illustration, can be implementedby special purpose hardware-based systems that perform the specifiedfunctions or acts or carry out combinations of special purpose hardwareand computer instructions.

It will be understood from the foregoing description that modificationsand changes may be made in various embodiments of the present inventionwithout departing from its true spirit. The descriptions in thisspecification are for purposes of illustration only and are not to beconstrued in a limiting sense. The scope of the present invention islimited only by the language of the following claims.

1. A method for managing flexible adapter configurations in a computersystem comprising: assigning an initial amount of resources to a set ofempty expansion bus slots of the computer system, wherein the initialamount of resources assigned to each empty expansion bus slot includes aset of assigned resources that is contiguous with an unassigned set ofresources; detecting an adapter has been attached to one of the set ofempty expansion bus slots; receiving, by a hypervisor, a request for anadditional amount of the resources for use by the detected adapter,wherein the additional amount of the resources are in addition to theinitial amount of the resources assigned to the expansion bus slotoccupied by the detected adapter; determining, by the hypervisor, anavailability of the additional amount of the resources for the detectedadapter; and in response to determining that the additional amount ofthe resources are available for the detected adapter, assigning, by thehypervisor at runtime, the requested additional amount of the resourcesto the detected adapter.
 2. The method of claim 1, further comprising:in response to determining that the additional resources are notavailable for the detected adapter, generating an error indicating thatthe additional resources are unavailable for the detected adapter. 3.The method of claim 1, wherein the additional resources compriseperipheral component interconnect (PCI) host bridge resources, andwherein the PCI host bridge resources comprise at least one selectedfrom a group consisting of a virtual function, a message signaledinterrupt address, and a memory mapping I/O address.
 4. The method ofclaim 1, wherein receiving, by the hypervisor, the request foradditional resources comprises reading, by the hypervisor, aconfiguration file for the detected adapter.
 5. The method of claim 1,wherein receiving, by the hypervisor, the request for additionalresources comprises: determining an amount of required resources for thedetected adapter; determining that the required resources are greaterthan the initial amount of resources assigned to the detected adapter.6. The method of claim 1, wherein assigning, by the hypervisor atruntime, the requested additional resources to the detected adaptercomprises: selecting a resource that is adjacent to the initialresources previously assigned to the detected adapter.
 7. The method ofclaim 1, wherein the detected adapter is a single root input/outputvirtualization (SR-IOV) adapter.
 8. An apparatus for managing flexibleadapter configurations in a computer system, the apparatus comprising acomputer processor, a computer memory operatively coupled to thecomputer processor, the computer memory having disposed within itcomputer program instructions that, when executed by the computerprocessor, cause the apparatus to carry out the steps of: assigning aninitial amount of resources to a set of empty expansion bus slots of thecomputer system, wherein the initial amount of resources assigned toeach empty expansion bus slot includes a set of assigned resources thatis contiguous with an unassigned set of resources; detecting an adapterhas been attached to one of the set of empty expansion bus slots;receiving, by a hypervisor, a request for an additional amount of theresources for use by the detected adapter, wherein the additional amountof the resources are in addition to the initial amount of the resourcesassigned to the expansion bus slot occupied by the detected adapter;determining, by the hypervisor, an availability of the additional amountof the resources for the detected adapter; and in response todetermining that the additional amount of the resources are availablefor the detected adapter, assigning, by the hypervisor at runtime, therequested additional amount of the resources to the detected adapter. 9.The apparatus of claim 8, wherein the computer program instructions,when executed by the computer processor, further cause the apparatus tocarry out the steps of: in response to determining that the additionalresources are not available for the detected adapter, generating anerror indicating that the additional resources are unavailable for thedetected adapter.
 10. The apparatus of claim 8, wherein the additionalresources comprise peripheral component interconnect (PCI) host bridgeresources, and wherein the PCI host bridge resources comprise at leastone selected from a group consisting of a virtual function, a messagesignaled interrupt address, and a memory mapping I/O address.
 11. Theapparatus of claim 8, wherein receiving, by the hypervisor, the requestfor additional resources comprises reading, by the hypervisor, aconfiguration file for the detected adapter.
 12. The apparatus of claim8, wherein receiving, by the hypervisor, the request for additionalresources comprises: determining an amount of required resources for thedetected adapter; determining that the required resources are greaterthan the initial amount of resources assigned to the detected adapter.13. The apparatus of claim 8, wherein assigning, by the hypervisor atruntime, the requested additional resources to the detected adaptercomprises: selecting a resource that is adjacent to the initialresources previously assigned to the detected adapter.
 14. The apparatusof claim 8, wherein the detected adapter is a single root input/outputvirtualization (SR-IOV) adapter.
 15. A computer program product formanaging flexible adapter configurations in a computer system, thecomputer program product disposed upon a computer readable medium, thecomputer program product comprising computer program instructions that,when executed, cause a computer to carry out the steps of: assigning aninitial amount of resources to a set of empty expansion bus slots of thecomputer system, wherein the initial amount of resources assigned toeach empty expansion bus slot includes a set of assigned resources thatis contiguous with an unassigned set of resources; detecting an adapterhas been attached to one of the set of empty expansion bus slots;receiving, by a hypervisor, a request for an additional amount of theresources for use by the detected adapter, wherein the additional amountof the resources are in addition to the initial amount of the resourcesassigned to the expansion bus slot occupied by the detected adapter;determining, by the hypervisor, an availability of the additional amountof the resources for the detected adapter; and in response todetermining that the additional amount of the resources are availablefor the detected adapter, assigning, by the hypervisor at runtime, therequested additional amount of the resources to the detected adapter.16. The computer program product of claim 15, wherein the computerprogram instructions, when executed, further cause a computer to carryout the steps of: in response to determining that the additionalresources are not available for the detected adapter, generating anerror indicating that the additional resources are unavailable for thedetected adapter.
 17. The computer program product of claim 15, whereinthe additional resources comprise peripheral component interconnect(PCI) host bridge resources, and wherein the PCI host bridge resourcescomprise at least one selected from a group consisting of a virtualfunction, a message signaled interrupt address, and a memory mapping I/Oaddress.
 18. The computer program product of claim 15, whereinreceiving, by the hypervisor, the request for additional resourcescomprises reading, by the hypervisor, a configuration file for thedetected adapter.
 19. The computer program product of claim 15, whereinreceiving, by the hypervisor, the request for additional resourcescomprises: determining an amount of required resources for the detectedadapter; determining that the required resources are greater than theinitial amount of resources assigned to the detected adapter.
 20. Thecomputer program product of claim 15, wherein assigning, by thehypervisor at runtime, the requested additional resources to thedetected adapter comprises: selecting a resource that is adjacent to theinitial resources previously assigned to the detected adapter.